home *** CD-ROM | disk | FTP | other *** search
-
- Example 1: C-SPRITE Macro Language
-
- 1 def example1 {
- 2 .count = 0
- 3 roff
- 4 while (.count < #0) { ; test against 1st parameter
- 5 g .symcmp+11, .xcexit ; break at .xcexit
- 6 if (ip == .xcexit) { ; are we at the end?
- 7 g ; yes, let program finish
- 8 break; ; ...and stop the loop
- 9 }
- 10 .count++
- 11 if (.count == 0t10) continue ; return to top of loop
- 12 echo This is the 10th iteration
- 13 ds [.p] .l1 ; display two strings only
- 14 ds [.#1] .l1 ; on the 10th iteration...
- 15 }
- 16 }